/*
  * @file Algorithm.cpp
  * @author Thibault Merle et Guillaume Poussel
  */
#include "algo/Algorithm.h"

point_list Algorithm::compute_hull(point_list points) {
    if (_with_opti) {
        point_list diamond = points.get_diamond();
        point_list points_to_compute(diamond.begin(), diamond.end());
        for (point_list::iterator it = points.begin();
             it != points.end(); ++it) {
            if (!diamond.contains(*it)) {
                points_to_compute.push_back(*it);
            }
        }
        return compute(points_to_compute);
    } else {
        return compute(points);
    }
}
